package com.andyage.bce;
import com.andyage.util.MyConfig;
import com.baidubce.Protocol;
import com.baidubce.auth.DefaultBceCredentials;
import com.baidubce.services.bos.BosClient;
import com.baidubce.services.bos.BosClientConfiguration;

public class Sample {
	static final String ACCESS_KEY_ID = MyConfig.ACCESS_KEY_ID; // 用户的Access Key
	// ID
	static final String SECRET_ACCESS_KEY = MyConfig.SECRET_ACCESS_KEY; // 用户的Secret
		// Key
	static final String ENDPOINT = MyConfig.ENDPOINT;

	public static BosClient createBosClient() {
		// 初始化一个BosClient
		BosClientConfiguration config = new BosClientConfiguration();
		config.setCredentials(new DefaultBceCredentials(ACCESS_KEY_ID,
				SECRET_ACCESS_KEY));
		config.setProtocol(Protocol.HTTP);
		config.setEndpoint(ENDPOINT);
		BosClient client = new BosClient(config);
		return client;
	}
	public static BosClientConfiguration createBosClientConfiguration() {
		BosClientConfiguration config = new BosClientConfiguration();
		config.setCredentials(new DefaultBceCredentials(ACCESS_KEY_ID,
				SECRET_ACCESS_KEY));
		config.setProtocol(Protocol.HTTP);
		config.setEndpoint(ENDPOINT);
		System.out.println("123");
		return config;
	}

	public static void main(String[] args) {
		System.out.println(ACCESS_KEY_ID);
	}

}